package com.springapp.mvc.filter;/**
 *
 */

import com.springapp.mvc.entity.Student;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.logging.Filter;
import java.util.logging.LogRecord;


public class LoginFilter implements Filter {
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//
//    }
//
//    @Override
//    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
//        HttpServletRequest hsp = (HttpServletRequest) req;
//        Student student = (Student) hsp.getSession().getAttribute("LoginUser");
//        if (student == null) {
//            ((HttpServletResponse) resp).sendRedirect(hsp.getContextPath() + "/login");
//        }
//        chain.doFilter(req, resp);
//    }
//
//    @Override
//    public void destroy() {
//
//    }

    @Override
    public boolean isLoggable(LogRecord record) {
        return false;
    }
}
